package edu.whu.webgis.aspect;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * @author 一个日志Aspect
 */

@Aspect
@Component
public class LogAspect {
    Logger logger = LoggerFactory.getLogger(getClass());

    @Pointcut("execution(* edu.whu.webgis.mapper.*.*(..))")
    public void ArtworkPointCut() {
    }

    @Before("ArtworkPointCut()")
    public void beforeDao(JoinPoint jp){
        StringBuilder info= new StringBuilder("进入了了" + jp.getSignature() + "方法,");
        info.append("参数是：");
        for (Object arg : jp.getArgs()) {
            info.append(arg).append(" ");
        }
        logger.info(info.toString());
    }
}
